import React, { useEffect, useState } from "react";
import Add from "../components/student/Add";
import Update from "../components/student/Update";
import Search from "../components/student/Search";
import List from "../components/student/List";

import { find } from "../services/student";
export default function (props) {
    let [students,setStudents] = useState([]);
    let [student,setStudent] = useState({});
    const show = async (params) => {
        let data = await find(params);
        setStudents(data.rows);
    }
    useEffect(() => {
       show();

    },[""]);
    return (
        <div>
            <h1>学生管理</h1>
            <Add show={show} />
            <Update student={student} setStudent={setStudent} show={show} />
            <Search show={show} />
            <List setStudent={setStudent} show={show} students={students} />
            {/*

    */}
        </div>
    );
}
